package JTools;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JTabbedPane;

public class Main extends JFrame {

	// Each pane will be in its own class
	// that we initiate and add to ourPane.
	private JTabbedPane ourPanel;
	private GenericPane pane1; // A panel that I made.
							   // Also that is a '1' not l.
	private GenericPane pane2;
	private TestCompositePanel cpanel;
	
	public Main() {
		
		setTitle("JTools v.01");
		setSize(800,600);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setResizable(true); // More than likely we want this to be true.
		setLocationRelativeTo(null);
		
		ourPanel = new JTabbedPane(); // Initialize our objects
		pane1 = new GenericPane();
		pane2 = new GenericPane("A fancy label!");
		cpanel = new TestCompositePanel();
		
		ourPanel.addTab("Generic panel 1", pane1); // Add our pane to the panel.
		ourPanel.addTab("Generic panel 2", pane2);
		ourPanel.addTab("Test panel", cpanel);
		
		add(ourPanel); // Have to add the panel to our JFrame.
		
	}
	
	/*
	 * Starts our app in a new thread so the UI is separate from any other
	 * computational stuff. Not sure if necessary, but it cant hurt too much.
	 */
	public static void main(String args[]) {
		
		EventQueue.invokeLater(new Runnable() {
			
			@Override
			public void run() {
				JFrame mainFrame = new Main();
				mainFrame.setVisible(true);
			}
		});
	}
	
	
}
